UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hFqtUJt+TuJ6hFGgzbhgElDKjL6iU1oKcr3T5wJDxTM=' 
WHERE 
  key_id = '6a36fa39f50eb3c36c0ad4df90fe012085b6969a61ae444371cde4b49bde2080' 
  AND (
    token = 'hFqtUJt+TuJ6hFGgzbhgElDKjL6iU1oKcr3T5wJDxTM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037