UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4OwLvNzb3zAP4wCyZfhxy4UcpuaTytsOABOaIcBErvU=' 
WHERE 
  key_id = '7196c99e19263686efc6aab1f577132f8d8c69bd286e2de9251eea079c2d6e6f' 
  AND (
    token = '4OwLvNzb3zAP4wCyZfhxy4UcpuaTytsOABOaIcBErvU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047