UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dsm3lGpQEljBDooLzBpePegRNzDZhCTO4AtyLED36aA='
WHERE
key_id = 'eb8c4cdfd1b2653ecdf811cf5d5e3688c865a6c04f29d02b98f306cae6015802'
AND (
token = 'dsm3lGpQEljBDooLzBpePegRNzDZhCTO4AtyLED36aA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)