UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5LEzcvtqm/UKQq1OURhfttxVEvh+S6apXFqWaEjVUHM=' 
WHERE 
  key_id = '86314fd3ee73e59b8c1d74dd239f3ce567e4f78e11db9593820dd4b15f4e23da' 
  AND (
    token = '5LEzcvtqm/UKQq1OURhfttxVEvh+S6apXFqWaEjVUHM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038