UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'i2OC0fLay0K0/CoP4aE7vF2q8Z9CNcfdeKfxWstsqN0='
WHERE
key_id = '9fd7ad5184d067a658537c048954b17a9cbaae57cd05bc0d5eba36a6039446b6'
AND (
token = 'i2OC0fLay0K0/CoP4aE7vF2q8Z9CNcfdeKfxWstsqN0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)