UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hRUHMuvwlmeRlAdM6dMjQJvmPB7l9DLMLjSMAvXiauU='
WHERE
key_id = '5c4ae1a19db6127db38fc1232910eea5e57c807d2d4cb9d8f65b2b27e94c3e4f'
AND (
token = 'hRUHMuvwlmeRlAdM6dMjQJvmPB7l9DLMLjSMAvXiauU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)