UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'O7zZ9Np++YDjvToZYrx8wyn7NyUEV73QluI76MJP2s0=' 
WHERE 
  key_id = '88e34d01d36e384d532f54a8f1e43f0f15da2c3c45a4f79a7156893e69d96b3b' 
  AND (
    token = 'O7zZ9Np++YDjvToZYrx8wyn7NyUEV73QluI76MJP2s0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025