UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oHpo2x0LMl4rx+CdCjESBUM2tbn6RrsLFZGg9sEs08A='
WHERE
key_id = 'f5f1a7229ce749455e2407571849414d95955d6b7522ee699bf6059a3489d75b'
AND (
token = 'oHpo2x0LMl4rx+CdCjESBUM2tbn6RrsLFZGg9sEs08A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)