UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '11rWMRb7D1QOeDtaPIKMHGpctxBdco9h7r03Z9a9RHg=' 
WHERE 
  key_id = 'ffbe5025531fb848bb41e26cf789b76acb0bfb3279900ec8c493f1163e156bbc' 
  AND (
    token = '11rWMRb7D1QOeDtaPIKMHGpctxBdco9h7r03Z9a9RHg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021