UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'c2+5LrY5Q0QhfMCvEB9rMs54vOvxnKA1Zv9AOzg8DJk='
WHERE
key_id = '3129186d672514488ad80521c88bd53a54e5c212e14359aac1f5a7c06c9546ef'
AND (
token = 'c2+5LrY5Q0QhfMCvEB9rMs54vOvxnKA1Zv9AOzg8DJk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)