UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'L0KI7J1hzZIwnJz4aqPXetpCUMrVSQsZaL2pLXxNeQU='
WHERE
key_id = '9ca7b19309b4e0a2a4f5c4b1b295b72d74bc04053b274af5d703753642025b31'
AND (
token = 'L0KI7J1hzZIwnJz4aqPXetpCUMrVSQsZaL2pLXxNeQU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)