UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PrTINTnPF75gefgQIe2UnLFD9k2FvbVvQGa+fTpqYiE=' 
WHERE 
  key_id = 'dc8ed429befe65b686f59951f14100ee4c617eca94c7f773f120778b4aadbb3e' 
  AND (
    token = 'PrTINTnPF75gefgQIe2UnLFD9k2FvbVvQGa+fTpqYiE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036