UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6qHbZuQ7BgCiLzHYTRvGaZbIUGz9aF6LoV5nzZIPmoc=' 
WHERE 
  key_id = '4dd0c904324b7c3ddfb7b97a18035717a4d26520a08733395e54f0f4c735803c' 
  AND (
    token = '6qHbZuQ7BgCiLzHYTRvGaZbIUGz9aF6LoV5nzZIPmoc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030