UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'g9fXymhSEvbnc/5SDva5aIFFJWSvbFx8VF6pQcWnbNI='
WHERE
key_id = '3717ce3ec4e26ad4db8d4bc03285a62d8c9334e1e96aa5af3af85588d6057c4f'
AND (
token = 'g9fXymhSEvbnc/5SDva5aIFFJWSvbFx8VF6pQcWnbNI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)