UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WNCLAhI0mDVD8A9HS4OaLdu+S0vqyaMPufk/uRmSJ24=' 
WHERE 
  key_id = '5abcf515209a1b92afde577a67001d176c275d10f4ac916246b4a71543cb4946' 
  AND (
    token = 'WNCLAhI0mDVD8A9HS4OaLdu+S0vqyaMPufk/uRmSJ24=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017