UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'U+e2AHaIBLX8jHfuK3BGX8MejgwBn4wKp3PSTdZvjoM=' 
WHERE 
  key_id = '76a0a8f0e1251429ed8da486691aa4e4564e7061f28c90e535ae1e13f7d1decd' 
  AND (
    token = 'U+e2AHaIBLX8jHfuK3BGX8MejgwBn4wKp3PSTdZvjoM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028