UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pxva2Tdn4Z7OXBiNpsvwyAIkWtXn6bZbjvYDplJkjcc=' 
WHERE 
  key_id = 'fdaa70e875dadab5cd50d2ab00bd7a82d8888d0b45e5861acc4b3f138d04a41a' 
  AND (
    token = 'pxva2Tdn4Z7OXBiNpsvwyAIkWtXn6bZbjvYDplJkjcc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00071