UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SFmRYkRNbrmGCRkZtj6UKC4G1sUXNJldgtnk91v+SI8='
WHERE
key_id = 'a70c7f463a79a646c53b25ce1d6a1a8f479ed33327290d6bb1e1cd4f1f5c9a79'
AND (
token = 'SFmRYkRNbrmGCRkZtj6UKC4G1sUXNJldgtnk91v+SI8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)