UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MhDHuXI+EQGQ43QLyNsGZ6zQD5c4HJWxfcTG1m04D8U='
WHERE
key_id = 'd93e6749ed35f32d98aff91bd3198b522d5c53d0205be4db99c66becb25ef919'
AND (
token = 'MhDHuXI+EQGQ43QLyNsGZ6zQD5c4HJWxfcTG1m04D8U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)