UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NVkrUeYiPdRfpNAo/zcibXJZOp5ytsxa0enEiO0Kk9w='
WHERE
key_id = 'da1ce80b331f7a2c5eece82488af5813b1fb221a5f84ebef235ccd91b30bf6e2'
AND (
token = 'NVkrUeYiPdRfpNAo/zcibXJZOp5ytsxa0enEiO0Kk9w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)