UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5hbzypVUyzRd0x8XEeXK5RRrbjwJFVKFz/apzn6O73E=' 
WHERE 
  key_id = 'a425310fdf7fb3f92c418c6cded2e1aaca4573d8a8244a0769148d83aa741e26' 
  AND (
    token = '5hbzypVUyzRd0x8XEeXK5RRrbjwJFVKFz/apzn6O73E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032