UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '66f3PTWs38h/i+swhFAkx5FoSQmVmQehv8AKxlKMZ78='
WHERE
key_id = '9cebb0480c3596637f1fff086054d9db11f6acdd9bcf380191ebd0a72d6c8cba'
AND (
token = '66f3PTWs38h/i+swhFAkx5FoSQmVmQehv8AKxlKMZ78='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)