UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WJfPrmtIG++rpWkzRHZpsOXw15/h+2LPtdvXTEERmAM=' 
WHERE 
  key_id = '3cb0bf4c6d9fb50a8df79c47b408b8acd94129b0072364e0aa06f1036d66bdc7' 
  AND (
    token = 'WJfPrmtIG++rpWkzRHZpsOXw15/h+2LPtdvXTEERmAM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038