UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'u/F3M7P9mv4YHob5eKH3jgY0p0+CI19yQCMtgXG1QJE='
WHERE
key_id = '0303ad8a4316a9c8fa847ae114a77e05d2050fe427dc544a4210d7922c552ced'
AND (
token = 'u/F3M7P9mv4YHob5eKH3jgY0p0+CI19yQCMtgXG1QJE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)