UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RJz10FARaiGMlnLfnbqGxj5IHT94bPJkD1rxYngeVi0=' 
WHERE 
  key_id = '68f39730c6249bcadf6c6b79cefdc3fab19819412309f694d440e7baeb16df00' 
  AND (
    token = 'RJz10FARaiGMlnLfnbqGxj5IHT94bPJkD1rxYngeVi0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027