UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pnCaYqF+W8PHb5TEbXv2DTR4qrBgjia8PWnYyMek0k0='
WHERE
key_id = '251fb4d2c9da77ee95a6cff6897d097032b60aed6bf096e97ba6b90554a98e5e'
AND (
token = 'pnCaYqF+W8PHb5TEbXv2DTR4qrBgjia8PWnYyMek0k0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)