UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IN/ZiKzVKEh2ZWZYoxBZiRqB+/1KJjavPdRt3KbYslo=' 
WHERE 
  key_id = 'dd18e3da5b1f85c2a2d4777a4d3aefc3c0e3b6134fea68ed768d0d6738b6506d' 
  AND (
    token = 'IN/ZiKzVKEh2ZWZYoxBZiRqB+/1KJjavPdRt3KbYslo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033