UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'U/DFUbdCzdWv1DmSfSPjtVu0pEkTamdmYhF8q4WZ2nQ=' 
WHERE 
  key_id = '5868353d87acf4914495bb10145747971310f0e8b862ba9198bf7d0ce99c47b8' 
  AND (
    token = 'U/DFUbdCzdWv1DmSfSPjtVu0pEkTamdmYhF8q4WZ2nQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034