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