UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qScS17smjWjrfRNIP+eLmIjIV6rC8ISFgAGk3mJY+7c='
WHERE
key_id = '7627c58c5db0250bf3a7ba341d4973d687ab5a7179a0b68d5d1d9a919b2763e8'
AND (
token = 'qScS17smjWjrfRNIP+eLmIjIV6rC8ISFgAGk3mJY+7c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)