UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/Ekk7zk4lKwjOUfTf+gZ9vj/DH7jTgowikhjZZs5rH8=' 
WHERE 
  key_id = '7cf0675165a970d8c4f70b126c9ab6ea57231c7cef6a46ba279e5a3f3a5c3746' 
  AND (
    token = '/Ekk7zk4lKwjOUfTf+gZ9vj/DH7jTgowikhjZZs5rH8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038