UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5vEu2pRkaJ2euJ6cvCsWxzTQkGH/i2GsDSgK1J4yEUc=' 
WHERE 
  key_id = '7e9acf34218c83fa3d39d62997d0a492e96e0249919bdaf466a19cecb4f6fc52' 
  AND (
    token = '5vEu2pRkaJ2euJ6cvCsWxzTQkGH/i2GsDSgK1J4yEUc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017