UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+u1zEk1vK5Cn94GBtdo0mUlkCLwvplFKFJqYKWCCzfo=' 
WHERE 
  key_id = '25aae6af33576f412014df5cba9c75ed6a8c74d305cd79bf7f39d27567e3dc2e' 
  AND (
    token = '+u1zEk1vK5Cn94GBtdo0mUlkCLwvplFKFJqYKWCCzfo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034