UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qag+WMUu/c9Bw8AaJjEmED+DzcrDesWaqOR/KB6y+fQ='
WHERE
key_id = 'c0f18458ed5dd66e8c93ad94a84ac2e30dfafdc2897b222df0ba5aec96ee75eb'
AND (
token = 'qag+WMUu/c9Bw8AaJjEmED+DzcrDesWaqOR/KB6y+fQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)