UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0yyN9JuUFYZoVSb0cTSgS0pgAGBrZZHilJzJbgNgkjo='
WHERE
key_id = 'cc0755e34bed134d83a44f0b1fdc8ee9ddec799ab2c8efe227ad567c6e94b389'
AND (
token = '0yyN9JuUFYZoVSb0cTSgS0pgAGBrZZHilJzJbgNgkjo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)