UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hGSqAmJtkR4C45F2SV+IhiTylclLTRE+9+DTSGVRQ/w=' 
WHERE 
  key_id = '04e1761fbcb6234b3f2655167a7b1dc291e0885ce748cab4a73ec4cb358835dd' 
  AND (
    token = 'hGSqAmJtkR4C45F2SV+IhiTylclLTRE+9+DTSGVRQ/w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047