UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '00tTf0lIBwcPxQMpllUh/KmqFpLSmZdu3AMCTTX88n8=' 
WHERE 
  key_id = '2063d421712b7fba36863113eff2cf90cb79ae1a16c4ff736c786f3602951c88' 
  AND (
    token = '00tTf0lIBwcPxQMpllUh/KmqFpLSmZdu3AMCTTX88n8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028