UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jx8bLSS3toTbE/SEmU9q7J1KpKI0vI9/bffbyI+sgUI='
WHERE
key_id = 'abee2c46929e8e368e5d03b15fa669ba0c79376fe3d22a3d164bd207199cf678'
AND (
token = 'jx8bLSS3toTbE/SEmU9q7J1KpKI0vI9/bffbyI+sgUI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)