UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xCxh+x2FpeVG85lT8V8rrEb+6f+z6uhWf2oIX+TQ9ok=' 
WHERE 
  key_id = '07b7fd6514487d20cb986400fbecd9e36d82b64e61c42243f2242ca1f54a4182' 
  AND (
    token = 'xCxh+x2FpeVG85lT8V8rrEb+6f+z6uhWf2oIX+TQ9ok=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052