UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nziDJdG8hZZEH7Ld98LWh+2Ng/Q+BJlnOYGQzxMapjU=' 
WHERE 
  key_id = '1d3d90dc5e73a7ef556f00e4b6ec724be5ab46a5c6b7de81b03a4b53ec1d07e2' 
  AND (
    token = 'nziDJdG8hZZEH7Ld98LWh+2Ng/Q+BJlnOYGQzxMapjU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015